{% extends 'base.htm' %}
{% block js %}
<script language="JavaScript" src="/static/js/tiny_mce/tiny_mce.js"></script>
{% endblock %}
{%block left%}&nbsp;{%endblock%}
{% block middle %}
<div id="navigation">
  <a href="../home">首页</a>->
  <a href="../doing">正在做事件</a>
  {%if blog%}
  -><a href="../event/?event={{blog.event.key}}">{{blog.event.title}}</a>
  {%endif%}
</div>

<div id="m1">
  <div class="title1">{%if blog%}修改{%else%}发表{%endif%}日志</div>
  <form  id="editblog" action="." method="post">
	<input name="bkey" type="hidden" value='{% if blog%}{{blog.key}}{%endif%}'>
	<div style="margin-top:10px;">标题：
	  <input type="text" name="title" class="box_title" value="{{blog.title|default:""}}"/>
	  <font size=2 color=Red font-weight:normal>{{error_msg}}</font>
	</div>
	<div style="margin-top:10px;">相关事件：
	  <select id="blog_event" name="event_key">
		<option value="None">不与任何事件相关</option>
		{%for event in events%}
		<option value="{{event.key}}" {%ifequal event.key def_event%}selected="selected"{%endifequal%}>
		{{event.title|default:""}}
		</option>
		{%endfor%}
	  </select>
	</div>
	<div style="margin-top:10px;">是否公开：
	  <select id="myevent_is_public" name="is_public">
		<option value="1" {% if not blog or blog.is_public%}selected="selected"{%endif%}>是</option>
		<option value="0" {% if blog and not blog.is_public %}selected="selected"{%endif%}>否</option>
	  </select>
    </div>
	<div style="margin-top:10px;">
	  <textarea name="content" rows=60 cols=40 style="height:450px;">{{blog.content|default:""}}</textarea>
	  <script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
	//		plugins :"pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
		plugins : "table,save,advimage,advlink,emotions,inlinepopups,insertdatetime,preview,searchreplace,contextmenu,paste,directionality,fullscreen",

		// Theme options
		theme_advanced_buttons1 : "code,save,undo,redo,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,anchor,image,cleanup|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,|,sub,sup,|,charmap,emotions,|,ltr,rtl,|,fullscreen",
//		theme_advanced_buttons4 : "moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "/static/style/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Style formats
		style_formats : [
			{title : 'Bold text', inline : 'b'},
			{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
			{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
			{title : 'Example 1', inline : 'span', classes : 'example1'},
			{title : 'Example 2', inline : 'span', classes : 'example2'},
			{title : 'Table styles'},
			{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
		],

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
	  </script>
	</div>
	<div style="margin-top:10px;">Tags：
	  <input type="text" name="tags" class="box_title" value="{{blog_tags}}"/><!--在view中格式化-->
	</div>
	<div><input name="" type="submit" value="" class="but_submit"/></div>
  </form>
</div>
{% endblock %}

	
